package cn.tedu.ivoswork.vehicle.controller;

import cn.tedu.ivoswork.base.response.JsonResult;
import cn.tedu.ivoswork.vehicle.pojo.dto.VehicleQuery;
import cn.tedu.ivoswork.vehicle.pojo.vo.VehicleVO;
import cn.tedu.ivoswork.vehicle.service.IVehicleService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@Slf4j
@RestController
@RequestMapping("/v1/vehicle")
public class VehicleController {
    @Autowired
    IVehicleService vehicleService;

    @GetMapping("select")
    public JsonResult select(VehicleQuery vehicleQuery){
        log.debug("查询车辆：参数={}",vehicleQuery);
        List<VehicleVO> list = vehicleService.select(vehicleQuery);
        return  JsonResult.ok(list);
    }
}
